function output=CDC_1(input,disp,slope,fs,L,a)
% % positive is to compensate the chromatic dispersion, 
Len = size(input,2) ;    
f = 193.1e12;
f_ref = 193.1e12;
f_step=fs/Len;
freq = ((0:1:Len-1)-Len/2)*f_step+(f-f_ref); %Frequence in Hz
lem = 2.9979246e8/f_ref*1e9;
Spec=fftshift(fft(input.').',2);
% Spec=fftshift(fft(input));
phase=(freq.^2.*-disp*L*1e-24*lem^2*pi/(2.9979246e8))+L*(lem*slope+2*disp)*1e-33*lem^3*pi.*freq.^3/3/(2.9979246e8)^2; 
Spec=Spec.*repmat(exp(1j*phase),size(input,1),1);
% Spec=Spec.*repmat(exp(1j*phase+a/4.342945*L/2),size(input,1),1);
% Spec=Spec.*repmat(exp(0.0461*1e-3*L/2),size(input,1),1);

output=ifft(fftshift(Spec,2).').';
% output=ifft(fftshift(Spec,2));
end
% Len = size(input,2) ;    
% 
% f_step=fs/Len;
% freq = ((0:1:Len-1)-Len/2)*f_step; %Frequence in Hz
% for lem = 1550.471
% Spec=fftshift(fft(input.').',2);
% phase=(freq.^2.*-disp*L*1e-24*lem^2*pi/(2.99e8))+L*(lem*slope+2*disp)*1e-33*lem^3*pi.*freq.^3/3/(2.99e8)^2; 
% % Spec=Spec.*repmat(exp(1j*phase),size(input,1),1);
% Spec=Spec.*repmat(exp(1j*phase+0.0461*1e-3*L/2),size(input,1),1);
% % Spec=Spec.*repmat(exp(0.0461*1e-3*L/2),size(input,1),1);
% 
% output=ifft(fftshift(Spec,2).').';
% end

